#define SIZE_R              16
#define SIZE_S              32
#define BYTES_VALUE         4
#define BYTES_TUPLE         8 
#define BYTES_BLK           64 
#define MAX_TUPLE_PBLK      7
#define MAX_BUF_NUM         8
#define MEM_R               SIZE_R/MAX_BUF_NUM
#define MEM_S               SIZE_S/MAX_BUF_NUM

#define tuple(x,tmpbuf) (tmpbuf[(x)/MAX_TUPLE_PBLK] + BYTES_TUPLE*((x) % MAX_TUPLE_PBLK))
#define get_turple_addr(x,tmpbuf) ((tmpbuf)+(x)*BYTES_TUPLE)